package com.itheima.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ColumnListHandler;

import com.itheima.utils.DataSourceUtils;

public class KwDao {

	public List<Object> findList(String kwname) throws SQLException {
		QueryRunner qr = new QueryRunner(DataSourceUtils.getDataSource());
		
		String sql = "select kwname from kw where kwname like ? limit 0,4";
		
		List<Object> query = qr.query(sql, new ColumnListHandler(), "%"+kwname+"%");
		return query;
	}

}
